package com.beyond.trace.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.beyond.trace.mapper.TraceSaleMapper;
import com.beyond.trace.domain.TraceSale;
import com.beyond.trace.service.ITraceSaleService;

/**
 * 销售信息Service业务层处理
 * 
 * @author yao
 * @date 2022-03-02
 */
@Service
public class TraceSaleServiceImpl extends ServiceImpl<TraceSaleMapper, TraceSale> implements ITraceSaleService
{
    @Resource
    private TraceSaleMapper traceSaleMapper;

    /**
     * 查询销售信息
     * 
     * @param saleId 销售信息ID
     * @return 销售信息
     */
    @Override
    public TraceSale selectTraceSaleById(Long saleId)
    {
        return traceSaleMapper.selectTraceSaleById(saleId);
    }

    /**
     * 查询销售信息列表
     * 
     * @param traceSale 销售信息
     * @return 销售信息
     */
    @Override
    public List<TraceSale> selectTraceSaleList(TraceSale traceSale)
    {
        return traceSaleMapper.selectTraceSaleList(traceSale);
    }

    /**
     * 新增销售信息
     * 
     * @param traceSale 销售信息
     * @return 结果
     */
    @Override
    public boolean insertTraceSale(TraceSale traceSale)
    {
        traceSale.setCreateTime(DateUtils.getNowDate());
        //return traceSaleMapper.insertTraceSale(traceSale);
        return super.save(traceSale);
    }

    /**
     * 修改销售信息
     * 
     * @param traceSale 销售信息
     * @return 结果
     */
    @Override
    public int updateTraceSale(TraceSale traceSale)
    {
        traceSale.setUpdateTime(DateUtils.getNowDate());
        return traceSaleMapper.updateTraceSale(traceSale);
    }

    /**
     * 批量删除销售信息
     * 
     * @param saleIds 需要删除的销售信息ID
     * @return 结果
     */
    @Override
    public int deleteTraceSaleByIds(Long[] saleIds)
    {
        return traceSaleMapper.deleteTraceSaleByIds(saleIds);
    }

    /**
     * 删除销售信息信息
     * 
     * @param saleId 销售信息ID
     * @return 结果
     */
    @Override
    public int deleteTraceSaleById(Long saleId)
    {
        return traceSaleMapper.deleteTraceSaleById(saleId);
    }
}
